home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / workbench+shell / a-f / alertpatch / patch.c < prev    next >
C/C++ Source or Header  |  1995-12-21  |  3KB  |  95 lines

  1. /*============================================================================*/
  2. /*=                                                                          =*/
  3. /*= Alertpatch V1.50                                                         =*/
  4. /*= by Ctryxx of Trinomic  23.01.95                                          =*/
  5. /*= © 1995                                                                   =*/
  6. /*=                                                                          =*/
  7. /*= now replaced the rülf                                                    =*/
  8. /*=                                                                          =*/
  9. /*============================================================================*/
  10.  
  11. #include <exec/exec.h>                        /* einbinden der Standard-Header-Dateien */
  12. #include <dos/dos.h>
  13. #include <intuition/intuitionbase.h>
  14.  
  15. #include <proto/exec.h>
  16. #include <proto/intuition.h>
  17.  
  18.  
  19. /*============================================================================*/
  20. /*= Deklaration von Funktionen                                               =*/
  21. /*============================================================================*/
  22.  
  23. BOOL __asm __saveds DisplayAlert_patch( register __d0 ULONG nr, register __a0 UBYTE *st, register __d1 LONG he );
  24.  
  25.  
  26. /*============================================================================*/
  27. /*= Deklaration von externen Variablen                                       =*/
  28. /*============================================================================*/
  29.  
  30. struct IntuitionBase *IntuitionBase = NULL;
  31.  
  32.  
  33. /*============================================================================*/
  34. /*= Patch der Funktion DisplayAlert, Alert->Requester                        =*/
  35. /*============================================================================*/
  36.  
  37. BOOL __asm __saveds DisplayAlert_patch( register __d0 ULONG nr, register __a0 UBYTE *st, register __d1 LONG he )
  38.  
  39. {    struct EasyStruct ReqText =
  40.    {    sizeof(struct EasyStruct),
  41.         0,
  42.         "AlertPatch V1.50 by Ctryxx/Trinomic",
  43.         0l,
  44.         "Schrompf|Bundeswehr!!!",
  45.      };
  46.  
  47.     ReqText.es_TextFormat = st+3;
  48.  
  49.     for( he=0; he<2; st++ )                        /*Bearbeiten des Alertstrings */
  50.     {    if ( *st == 0 )
  51.         {    *st = 32;
  52.             he++;
  53.         }
  54.         else
  55.         {    he = 0;
  56.         }
  57.  
  58.         if ( *st == 1 )
  59.         {    *st = 32;
  60.             *(st+1) = 32;
  61.             *(st+2) = 32;
  62.             *(st+3) = 10;
  63.         }
  64.     }
  65.  
  66.     return( (BOOL)EasyRequest(0l, &ReqText, 0l) );
  67. }
  68.  
  69.  
  70. /*============================================================================*/
  71. /*= Installer für den Patch                                                  =*/
  72. /*============================================================================*/
  73.  
  74. void main( void )
  75.  
  76. {    APTR    displayAlert;
  77.  
  78.     if (! (IntuitionBase = OpenLibrary( "intuition.library",0l )) )
  79.     {    CloseLibrary( IntuitionBase );
  80.         exit( 0 );
  81.     }
  82.  
  83.     Forbid();
  84.     displayAlert = SetFunction( IntuitionBase, -90, DisplayAlert_patch );
  85.     Permit();
  86.     Wait( SIGBREAKF_CTRL_C | SIGBREAKF_CTRL_D );
  87.     
  88.     Forbid();
  89.     SetFunction( IntuitionBase, -90, displayAlert );
  90.     Permit();
  91.     CloseLibrary( IntuitionBase );
  92.  
  93.     exit( 0 );
  94. }
  95.